<?php  
// src/Asiah/SiklusBundle/Entity/Tag.php
namespace Asiah\SiklusBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity(repositoryClass="Asiah\SiklusBundle\Repository\TagRepository")
 * @ORM\Table(name="tag")
 */

class Tag {
	public function __construct() {
		$this -> bookmarks = new ArrayCollection();
	}

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	protected $id;
	/**
	 * @ORM\Column(type="string", unique=true, length="30")
	 */
	protected $name;

	/**
	 * @ORM\ManyToMany(targetEntity="Bookmark", mappedBy="tags")
	 */
	protected $bookmarks;

	/**
	 * Get id
	 *
	 * @return integer
	 */
	public function getId() {
		return $this -> id;
	}

	/**
	 * Set name
	 *
	 * @param string $name
	 */
	public function setName($name) {
		$this -> name = $name;
	}

	/**
	 * Get name
	 *
	 * @return string
	 */
	public function getName() {
		return $this -> name;
	}


    /**
     * Add bookmarks
     *
     * @param Asiah\SiklusBundle\Entity\Bookmark $bookmarks
     */
    public function addBookmarks(\Asiah\SiklusBundle\Entity\Bookmark $bookmarks)
    {
        $this->bookmarks[] = $bookmarks;
    }

    /**
     * Get bookmarks
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getBookmarks()
    {
        return $this->bookmarks;
    }

    /**
     * Add bookmarks
     *
     * @param Asiah\SiklusBundle\Entity\Bookmark $bookmarks
     */
    public function addBookmark(\Asiah\SiklusBundle\Entity\Bookmark $bookmarks)
    {
        $this->bookmarks[] = $bookmarks;
    }
}